#!/usr/bin/env python3
# coding:utf-8
import timeit

# 性能测试
t1 = timeit.timeit(
    """
name = "lilisi"
age = 18
profession = "student"
'Hi %s, info:age=%d, profession=%s'%(name,age,profession)
""",
    number=10000,
)
print("%s fromat:", t1)

t2 = timeit.timeit(
    """
name = "lilisi"
age = 18
profession = "student"
f'Hi {name}, info:age={age}, profession={profession}'
""",
    number=10000,
)
print("fast string fromat:", t2)

# 测试结果:
# %s fromat: 0.0011138669942738488
# fast string fromat: 0.0008853670005919412
